<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>大连交通大学在线服务平台</title>
<link href="css/bootstrap.min.css" rel="stylesheet" />
<link href="css/common.css" rel="stylesheet" />
<link href="images/favicon.ico" rel="shortcut icon" />
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/bootstrapValidator.min.js"></script>
<script src="js/language/zh_CN.js"></script>
<script src="js/common.js"></script>
</head>
<body>
	<%@include file="subpage/head.jsp"%>
	<div class="container">
		<div class="logo-div">
			<div class="img-logo">
				<img id="img-logo" src="images/logo.png" alt="大连交通大学" />
			</div>
			<div class="search-div">
				<form action="#" method="post" class="navbar-form">
					<div class="input-group">
						<span class="input-group-btn"> <label for="sel-search" class="sr-only"></label> <select
							class="form-control" name="type" id="sel-search">
								<option value="goods">二手物品</option>
								<option value="news">新闻资讯</option>
								<option value="lost">失物招领</option>
						</select></span> <input class="form-control" type="text" name="wd" placeholder="请输入要查找的内容" /> <span
							class="input-group-btn">
							<button id="btn-search" type="submit" class="btn btn-default">搜索</button>
						</span>
					</div>
				</form>
			</div>
			<div class="img-er">
				<img id="img-er" src="images/er.png" width="90px" height="90px" alt="二维码" />
			</div>
		</div>
		<nav class="navbar navbar-default">
			<ul class="nav nav-pills nav-justified">
				<li class="active"><a href="index.jsp">首页</a></li>
				<li><a href="secondhand.jsp">二手物品</a></li>
				<li><a href="lost.jsp">失物招领</a></li>
				<li><a href="news.jsp">新闻资讯</a></li>
				<li><a href="car.jsp">校车查询</a></li>
				<c:if test="${not empty user}">
					<li><a href="user.jsp">用户中心</a></li>
				</c:if>
			</ul>
		</nav>
	</div>
	<br />

	<div class="container">
		<div class="row">
			<div class="col-md-8">
				<div id="carousel-example-generic" class="carousel slide  " data-ride="carousel">
					<!-- 点选
                <ol class="carousel-indicators">
                    <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
                    <li data-target="#carousel-example-generic" data-slide-to="1"></li>
                    <li data-target="#carousel-example-generic" data-slide-to="2"></li>
                </ol>
                -->
					<!-- Wrapper for slides -->
					<div class="carousel-inner" role="listbox">
						<div class="item active">
							<img src="images/3.jpg" alt="...">

							<div class="carousel-caption"></div>
						</div>
						<div class="item">
							<img src="images/1.jpg" alt="...">

							<div class="carousel-caption"></div>
						</div>
						<div class="item">
							<img src="images/2.jpg" alt="...">

							<div class="carousel-caption"></div>
						</div>
					</div>
					<!-- Controls -->
					<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev"> <span
						class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span> <span class="sr-only">Previous</span>
					</a> <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
						<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> <span class="sr-only">Next</span>
					</a>
				</div>
			</div>
			<div class="col-md-4">
				<form action="index/user_i_login.do" method="post" class="form-signin">
					<div class="list-group">
						<p class="list-group-item active">
							<img src="images/login.png" width="20px" height="20px" alt="" /> 登录平台
						</p>
						<c:choose>
							<c:when test="${not empty user}">
								<div class="block-center">
									<h3 style="color: gold; margin-top: 20px; margin-bottom: 0px; margin-left: 10%">
										<font color="black">欢迎用户：</font>${user.realname}</h3>
									<br> <a href="user.jsp" class="btn btn-success btn-block btn-lg glyphicon glyphicon-cog">&nbsp;用户中心</a>
									<a onclick="loginOut()" class="btn btn-danger btn-block btn-lg glyphicon glyphicon-off">&nbsp;退出&nbsp;&nbsp;</a>
								</div>
							</c:when>
							<c:otherwise>
								<div class="input-group">
									<span class="input-group-addon">校园卡号：</span> <input name="uid" type="text" class="form-control"
										placeholder="请输入卡号" required>
								</div>
								<div class="input-group">
									<span class="input-group-addon">服务密码：</span> <input name="pwd" type="password" class="form-control"
										placeholder="请输入密码" required>
								</div>
								<div class="input-group">
									<span class="input-group-addon"> <img src="index/getImage.do"
										onclick="this.src='index/getImage.do?'+ Math.random()" title="点击图片刷新验证码" />
									</span> <input name="code" type="text" class="form-control" placeholder="请输入4位验证码" required>
								</div>
                    ${loginMsg}
                    <div class="list-group">
									<button class="btn btn-block btn-success" type="submit" style="margin-top: 12px">登录</button>
								</div>
							</c:otherwise>
						</c:choose>
					</div>
				</form>
			</div>
		</div>
		<br>
		<div class="row">
			<div class="col-md-8">
				<div class="list-group">
					<p class="list-group-item active">
						<img src="images/news.png" width="20px" height="20px" alt="" /> 新闻资讯 <span class="more-info"> <a
							href="news.jsp">更多 ></a>
						</span>
					</p>
					<c:forEach items="${application.index_news}" var="news" begin="0" end="4">
						<a href="index/news_show.do?nid=${news.nid}" class="list-group-item"><fmt:formatDate
								value="${news.pubdate}" pattern="yyyy.MM.dd" /> ${news.title}</a>
					</c:forEach>
				</div>
			</div>
			<div class="col-md-4">
				<div class="list-group">
					<p class="list-group-item active">
						<img src="images/lost.png" width="20px" height="20px" alt="" /> 失物招领 <span class="more-info"> <a
							href="lost.jsp">更多 ></a>
						</span>
					</p>
					<c:forEach items="${application.index_lost}" var="lost" begin="0" end="4">
						<a href="lost.jsp?lid=${lost.lid}" class="list-group-item">${lost.phone} 捡到 ${lost.name} </a>
					</c:forEach>
				</div>
			</div>
		</div>
		<br>
		<div class="row">
			<div class="col-md-8">
				<div class="list-group">
					<p class="list-group-item active">
						<img src="images/ershou.png" width="20px" height="20px" alt="" /> 最新二手 <span class="more-info">
							<a href="secondhand.jsp">更多 ></a>
						</span>
					</p>
					<p></p>
					<div class="row">
						<c:forEach items="${application.index_goods}" var="goods" begin="0" end="3">
							<div class="col-md-3">
								<a href="index/goods_show.do?gid=${goods.gid}" class="thumbnail"> <img src="${goods.imgurl}"
									style="width: 100px; height: 100px;" alt="${goods.name}">
									<p>${goods.name}</p>
									<p class="price">￥${goods.price}</p>
								</a>
							</div>
						</c:forEach>
					</div>
				</div>
			</div>
			<div class="col-md-4">
				<div class="list-group">
					<p class="list-group-item active">
						<img src="images/bus.png" width="20px" height="20px" alt="" /> 班车查询 <span class="more-info"> <a
							href="car.jsp">详细 ></a>
						</span>
					</p>
					<c:forEach items="${application.index_car}" var="car" begin="0" end="5">
						<a href="car.jsp?cid=${car.carid}" class="list-group-item">${car.locationstart}-${car.locationend} <fmt:formatDate
								value="${car.starttime}" pattern="a HH:mm" />-<fmt:formatDate value="${car.endtime}" pattern="HH:mm" />
						</a>
					</c:forEach>
				</div>

			</div>
		</div>
	</div>
	<div class="container">
		<div class="index-foot-div">
			<!-- 底部栏 -->
			<%@include file="subpage/footer.jsp"%>
		</div>
	</div>
	<!--end body div-->
</body>
</html>